/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * Entidade Admin
 */
@Entity
@Table(name = "admin", catalog = "agenciadeviagem", schema = "")
@NamedQueries(
{
    @NamedQuery(name = "Admin.findAll", query = "SELECT a FROM Admin a"),
    @NamedQuery(name = "Admin.findByLogin", query = "SELECT a FROM Admin a WHERE a.login = :login"),
    @NamedQuery(name = "Admin.findByNome", query = "SELECT a FROM Admin a WHERE a.nome = :nome"),
    @NamedQuery(name = "Admin.findBySenha", query = "SELECT a FROM Admin a WHERE a.senha = :senha"),
    @NamedQuery(name = "Admin.validaAcessoAdmin", query = "SELECT a FROM Admin a WHERE a.nome = :nome and a.senha = :senha")
}
)
public class Admin implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "login", nullable = false, length = 20)
    private String login;
    @Basic(optional = false)
    @Column(name = "Nome", nullable = false, length = 20)
    private String nome;
    @Basic(optional = false)
    @Column(name = "senha", nullable = false, length = 20)
    private String senha;

    /**
     * Construtor Default
     */
    public Admin() {
    }

    /**
     *
     * @param login
     */
    public Admin(String login) {
        this.login = login;
    }

    /**
     *
     * @param login
     * @param nome
     * @param senha
     */
    public Admin(String login, String nome, String senha) {
        this.login = login;
        this.nome = nome;
        this.senha = senha;
    }

    /**
     *
     * @return String
     */
    public String getLogin() {
        return login;
    }

    /**
     *
     * @param login
     */
    public void setLogin(String login) {
        this.login = login;
    }

    /**
     *
     * @return String
     */
    public String getNome() {
        return nome;
    }

    /**
     *
     * @param nome
     */
    public void setNome(String nome) {
        this.nome = nome;
    }

    /**
     *
     * @return String
     */
    public String getSenha() {
        return senha;
    }

    /**
     *
     * @param senha
     */
    public void setSenha(String senha) {
        this.senha = senha;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (login != null ? login.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Admin)) {
            return false;
        }
        Admin other = (Admin) object;
        if ((this.login == null && other.login != null) || (this.login != null && !this.login.equals(other.login))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entidades.Admin[login=" + login + "]";
    }

}
